﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.EntityClient;
using InspectionDAL;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace InspectionPageFlow
{     
    public sealed class EnregistrerDonneesActivity : CodeActivity
    {
        public InArgument<Inspection> Inspection { get; set; }
        
        protected override void Execute(CodeActivityContext context)
        {
            Inspection inspection = Inspection.Get(context);

            using (InspectionEntities bd = new InspectionEntities())
            {
                bd.Inspection.AddObject(inspection);
                bd.SaveChanges();
            }
        }
    }
}
